
#include "tetrahedron.h"

Tetrahedron :: Tetrahedron () : Polyhedra ()
{
	Tetrahedron (this->Size());
}

Tetrahedron :: Tetrahedron (float _size) : Polyhedra (_size)
{
	Tetrahedron (_size, i, r);
}

Tetrahedron :: Tetrahedron (float _size, int _i, float _r) 
	: Polyhedra (_size, _i, _r)
{
	num_pts = 4;
	p = new Point[num_pts];
	SetPoint (_size);
}

Tetrahedron :: ~Tetrahedron ()
{
	Polyhedra::~Polyhedra();
	if (p)
		delete p;
}

void Tetrahedron :: SetPoint (float _size)
{
	Polyhedra :: SetPoint (_size/2.0f);

	p[0].SetPoint (size, size, size);
	p[1].SetPoint (-size, size, -size);
	p[2].SetPoint (size, -size, -size);
	p[3].SetPoint (-size, -size, size);
}

void Tetrahedron :: _Draw (Point* pts)
{
	DrawFace (pts[0], pts[1], pts[2]);
	DrawFace (pts[3], pts[2], pts[1]);
	DrawFace (pts[0], pts[2], pts[3]);
	DrawFace (pts[3], pts[1], pts[0]);
}
